//优化
import VueRouter from 'vue-router'
function enhance(props) {
  const nativeFn = VueRouter.prototype[props];
  VueRouter.prototype[props] = function(to,onComplete,onAbort){
    if (onAbort === undefined) {
      //注意返回promise
      // console.log(111)
      // return nativeFn.call(this.to,onComplete,() => {})
      return nativeFn.call(this,to,onComplete,() => {})
    } else {
      return nativeFn.call(this,to,onComplete,onAbort)
    }
  }
}

export default enhance;